import { Suspense, type ComponentType } from "react";

export const withSuspense = (Component: ComponentType) => (
    <Suspense
        fallback={
            <div className="flex items-center justify-center">
                Loading...
            </div>
        }
    >
        <Component />
    </Suspense>
);